package com.user.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.user.domain.pojo.Permission;
import com.user.domain.pojo.Role;
import com.user.domain.pojo.User;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 小杰大人
 * @since 2025-02-17
 */
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from `user` where id = #{id}")
    User querySelectById(Long id);

    @Select("select * from `user` where username = #{username}")
    User querySelectByUsername(String username);

    @Select("select * from `user` where phone = #{phone}")
    User querySelectByPhone(String phone);

    List<Role> querySelectRoleByUsername(String username);

    List<Role> querySelectRoleById(Long id);

    List<Permission> querySelectPermissionByUsername(String username);

}
